<?php

namespace App\Listeners;

use App\Events\BoxOrderPaidEvent;
use App\Jobs\CloseBoxOrderJob;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use App\Services\BuyVip\BuyVip;

class BoxOrderPaidListener
{
    public function handle(BoxOrderPaidEvent $event)
    {
      dispatch(new CloseBoxOrderJob($event->blindBoxOrder))->onQueue('default');
        /*if ($purchase = $event->vipPurchase) {
             app(BuyVip::class, [
                'user' => $purchase->user,
                'vip_category_id' => $purchase->vip_category_id,
            ])->bought();
        }*/
    }
}
